<template>
  <div class="detailedInfo">
    <div class="content-left">
      <div class="title">已添加企微号</div>
      <ul class="userList">
        <li>
          <img src="../../../assets/images/profile.jpg"/>
          <div class="name">小城红</div>
          <div class="label">@志新</div>
        </li>
      </ul>
    </div>
    <div class="content-center">
      <el-form
        ref="form"
        :model="form"
        :rules="rules"
        label-width="100px"
        label-position="left"
      >
        <el-form-item label="备注：" prop="name">
          <el-input
            v-model="form.name"
            maxlength="20"
            show-word-limit
            placeholder="请输入备注"
          />
        </el-form-item>
        <el-form-item label="企微标签：" prop="password">
          <treeselect v-model="form.selectedItems" :defaultExpandLevel="Infinity" :multiple="true" placeholder="请选择" :options="treeData"></treeselect>
        </el-form-item>
        <el-form-item label="个人标签：" prop="phone">
          <treeselect v-model="form.selectedItems" :defaultExpandLevel="Infinity" :multiple="true" placeholder="请选择" :options="treeData"></treeselect>
        </el-form-item>
        <el-form-item label="智能标签：" prop="email">
          <div class="label-list">
            <span>一般 <i class="el-icon-close"></i></span>
            <span>重要 <i class="el-icon-close"></i></span>
            <span>核心<i class="el-icon-close"></i></span>
          </div>
        </el-form-item>
        <el-form-item label="添加时间：" prop="">
          <span>{{ form.last_login_time || "-" }}</span>
        </el-form-item>
        <el-form-item label="来源：" prop="">
          <span>{{ form.create_time || "-" }}</span>
        </el-form-item>
        <el-form-item label="电话：" prop="">
          <span>{{ form.create_time || "-" }}</span>
        </el-form-item>
        <el-form-item label="描述：" prop="">
          <el-input type="textarea" v-model="form.desc"></el-input>
        </el-form-item>
      </el-form>
    </div>
    <div class="content-right">
      <div class="title">行为轨迹 <span>保留近1个月且在线期间的记录</span></div>
      <div class="content-list">
        <el-select v-model="value" placeholder="请选择">
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value">
          </el-option>
        </el-select>
        <ul class="history-list">
          <li>
             <span></span>
            <div class="li-title">删除智能标签【<1000】</div>
             <div class="li-time">2024-03-15 16:34:45</div>
          </li>
          <li>
            <span></span>
            <div class="li-title">新增智能标签【<1000】、【1000~5000】、【>5000】、【1次】、【2次】、【3次及以上】、【VIP】、【hgjhjg】</div>
            <div class="li-time">2024-03-15 16:34:45</div>
          </li>
          <li>
            <span></span>
            <div class="li-title">删除智能标签【<1000】</div>
            <div class="li-time">2024-03-15 16:34:45</div>
          </li>
          <li>
            <span></span>
            <div class="li-title">删除智能标签【<1000】</div>
            <div class="li-time">2024-03-15 16:34:45</div>
          </li>
          <li>
            <span></span>
            <div class="li-title">删除智能标签【<1000】</div>
            <div class="li-time">2024-03-15 16:34:45</div>
          </li>
          <li>
            <span></span>
            <div class="li-title">删除智能标签【<1000】</div>
            <div class="li-time">2024-03-15 16:34:45</div>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
  name: 'detailedInfo',
  components: {
    Treeselect
  },
  data() {
    return {
      form: {
      },
      treeData: [
        {
          id: 1,
          label: "水果",
          children: [
            {id: 2, label: "西瓜"},
            {id: 3, label: "香蕉"},
            {id: 4, label: "橙子"},
          ],
        },
        {
          id: 5,
          label: "蔬菜",
          children: [
            {id: 6, label: "西红柿"},
            {id: 7, label: "黄瓜"},
            {id: 8, label: "青菜"},
          ],
        },
        {
          id: 9,
          label: "零食",
          children: [
            {id: 10, label: "薯片"},
            {id: 11, label: "巧克力"},
          ],
        },
      ],
      options: [{
        value:1,
        label: '全部'
      }, {
        value:2,
        label: '群标签变更'
      }, {
        value: 3,
        label: '标签变更'
      }, {
        value:4,
        label: '其他'
      }
      ],
      value: '',
      rules: {
        'name': [
          {required: true, message: '请输入标签名称', trigger: 'blur'}
        ],

      },
    }
  },
  created() {
  },
  mounted() {
  },
  watch: {},
  methods: {
    onSubmit(formName) {
      //提交的代码
      this.$refs[formName].validate((valid) => {
        if (valid) {
          console.log('提交表单');
        } else {
          console.log('error submit!!');
          return false;
        }
      });
    },
    handleCloseDialog() {
      this.$emit('update:visableIf', false);
      this.$emit('handleQuery');
    }
  }
}
</script>

<style scoped lang="scss">
.detailedInfo {
  display: flex;

  .content-left {
    padding-left: 20px;
    padding-top: 20px;
    border-right: 1px solid #eee;
    width: 260px;
    .title {
      color: rgba(0, 0, 0, .45);
      font-size: 14px;
      margin-bottom:20px;
    }
    .userList {
      li {
        border-radius: 4px;
        margin: 8px 0;
        cursor: pointer;
        position: relative;
        padding-left:50px;
        font-size: 14px;
        list-style: none;
        img {
          width: 40px;
          height: 40px;
          border-radius: 8px;
          left: 0px;
          top: 0px;
          position: absolute;
        }
        .name {

        }
        .label{
          margin-top: 2px;
          font-size: 12px;
          font-family: PingFangSC-Regular, PingFang SC;
          font-weight: 400;
          color: #f90;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
      }
    }
  }
  .content-center {
   margin-right: 50px;
    flex: 1;
    margin-left: 60px;
   ::v-deep .el-form {
     padding-top: 20px;
      .el-form-item {
        .el-form-item__label {
          text-align: right;
          height: 32px;
        }
        .el-form-item__content {
          height: 32px;
          line-height: 32px;
          .el-input--medium .el-input__inner {
            height: 32px;
            line-height: 32px;
          }
        }
        .el-input {
          width: 350px;
        }
         .vue-treeselect {
          width: 350px;
           .vue-treeselect__control {
            line-height: 32px;
            height: 32px;
          }
        }
      }
    }
    .label-list {
      span {
        margin: 4px 4px 4px 0;
        font-size: 12px;
        height: 25px;
        line-height: 25px;
        white-space: nowrap;
        background: #f0f0f0;
        border: 1px solid #e9e9e9;
        border-radius: 4px;
        padding: 0px 7px;
        display: inline-block;
        color: rgba(0, 0, 0, .65);
        i {
          cursor: pointer;
        }

      }
    }
  }
  .content-right{
    width: 350px;
    padding-right: 15px;
    .title {
      font-size: 14px;
      display: flex;
      justify-content: space-between;
      padding:20px 0;
      span {
        color: #888;
      }
    }
    .history-list {
      padding: 20px 20px;
      background: #f7f7f7;
      border-radius: 4px;
      margin-top: 15px;
      li {
        color: #888;
        list-style: none;
        font-size: 14px;
        border-left: 1px solid #3070ff;
        padding: 0px 20px;
        position: relative;
        padding-bottom: 20px;
        &:last-child{
          border-left: none;
        }
        span {
          height: 20px;
          width: 20px;
          display: flex;
          background: #f7f7f7;
          position: absolute;
          left: -10px;
          top: 0px;
          align-items: center;
          justify-content: center;
          &:after {
            content:'';
            background: #3070ff;
            width: 10px;
            height: 10px;
            border-radius: 50%;

          }
        }
        .li-title {
          margin-bottom: 5px;
        }
      }
    }
  }
}


</style>
